package app.base.systemmanage.systemrolespermsmanage.dao;

import java.util.List;
import java.util.Map;

import app.base.systemmanage.systemrolespermsmanage.model.SysRolesPermsMapping;
import app.base.systemmanage.systemrolespermsmanage.model.SysRolesPermsMappingExample;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.ibatis.sqlmap.client.SqlMapClient;

public class SysRolesPermsMappingDAOImpl extends SqlMapClientDaoSupport implements SysRolesPermsMappingDAO {

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table SYS_ROLES_PERMS_MAPPING
     *
     * @ibatorgenerated Fri Jul 10 15:45:18 CST 2009
     */
    public SysRolesPermsMappingDAOImpl() {
        super();
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table SYS_ROLES_PERMS_MAPPING
     *
     * @ibatorgenerated Fri Jul 10 15:45:18 CST 2009
     */
    public int countByExample(SysRolesPermsMappingExample example) {
        Integer count = (Integer)  getSqlMapClientTemplate().queryForObject("SYS_ROLES_PERMS_MAPPING.ibatorgenerated_countByExample", example);
        return count.intValue();
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table SYS_ROLES_PERMS_MAPPING
     *
     * @ibatorgenerated Fri Jul 10 15:45:18 CST 2009
     */
    public int deleteByExample(SysRolesPermsMappingExample example) {
        int rows = getSqlMapClientTemplate().delete("SYS_ROLES_PERMS_MAPPING.ibatorgenerated_deleteByExample", example);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table SYS_ROLES_PERMS_MAPPING
     *
     * @ibatorgenerated Fri Jul 10 15:45:18 CST 2009
     */
    public int deleteByPrimaryKey(String ROLE_PERM_ID) {
        SysRolesPermsMapping key = new SysRolesPermsMapping();
        key.setROLE_PERM_ID(ROLE_PERM_ID);
        int rows = getSqlMapClientTemplate().delete("SYS_ROLES_PERMS_MAPPING.ibatorgenerated_deleteByPrimaryKey", key);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table SYS_ROLES_PERMS_MAPPING
     *
     * @ibatorgenerated Fri Jul 10 15:45:18 CST 2009
     */
    public void insert(SysRolesPermsMapping record) {
        getSqlMapClientTemplate().insert("SYS_ROLES_PERMS_MAPPING.ibatorgenerated_insert", record);
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table SYS_ROLES_PERMS_MAPPING
     *
     * @ibatorgenerated Fri Jul 10 15:45:18 CST 2009
     */
    public void insertSelective(SysRolesPermsMapping record) {
        getSqlMapClientTemplate().insert("SYS_ROLES_PERMS_MAPPING.ibatorgenerated_insertSelective", record);
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table SYS_ROLES_PERMS_MAPPING
     *
     * @ibatorgenerated Fri Jul 10 15:45:18 CST 2009
     */
    @SuppressWarnings("unchecked")
	public List selectByExample(SysRolesPermsMappingExample example) {
        List list = getSqlMapClientTemplate().queryForList("SYS_ROLES_PERMS_MAPPING.ibatorgenerated_selectByExample", example);
        return list;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table SYS_ROLES_PERMS_MAPPING
     *
     * @ibatorgenerated Fri Jul 10 15:45:18 CST 2009
     */
    public SysRolesPermsMapping selectByPrimaryKey(String ROLE_PERM_ID) {
        SysRolesPermsMapping key = new SysRolesPermsMapping();
        key.setROLE_PERM_ID(ROLE_PERM_ID);
        SysRolesPermsMapping record = (SysRolesPermsMapping) getSqlMapClientTemplate().queryForObject("SYS_ROLES_PERMS_MAPPING.ibatorgenerated_selectByPrimaryKey", key);
        return record;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table SYS_ROLES_PERMS_MAPPING
     *
     * @ibatorgenerated Fri Jul 10 15:45:18 CST 2009
     */
    public int updateByExampleSelective(SysRolesPermsMapping record, SysRolesPermsMappingExample example) {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = getSqlMapClientTemplate().update("SYS_ROLES_PERMS_MAPPING.ibatorgenerated_updateByExampleSelective", parms);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table SYS_ROLES_PERMS_MAPPING
     *
     * @ibatorgenerated Fri Jul 10 15:45:18 CST 2009
     */
    public int updateByExample(SysRolesPermsMapping record, SysRolesPermsMappingExample example) {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = getSqlMapClientTemplate().update("SYS_ROLES_PERMS_MAPPING.ibatorgenerated_updateByExample", parms);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table SYS_ROLES_PERMS_MAPPING
     *
     * @ibatorgenerated Fri Jul 10 15:45:18 CST 2009
     */
    public int updateByPrimaryKeySelective(SysRolesPermsMapping record) {
        int rows = getSqlMapClientTemplate().update("SYS_ROLES_PERMS_MAPPING.ibatorgenerated_updateByPrimaryKeySelective", record);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table SYS_ROLES_PERMS_MAPPING
     *
     * @ibatorgenerated Fri Jul 10 15:45:18 CST 2009
     */
    public int updateByPrimaryKey(SysRolesPermsMapping record) {
        int rows = getSqlMapClientTemplate().update("SYS_ROLES_PERMS_MAPPING.ibatorgenerated_updateByPrimaryKey", record);
        return rows;
    }

    /**
     * This class was generated by Apache iBATIS ibator.
     * This class corresponds to the database table SYS_ROLES_PERMS_MAPPING
     *
     * @ibatorgenerated Fri Jul 10 15:45:18 CST 2009
     */
    private static class UpdateByExampleParms extends SysRolesPermsMappingExample {
        private Object record;

        public UpdateByExampleParms(Object record, SysRolesPermsMappingExample example) {
            super(example);
            this.record = record;
        }

        public Object getRecord() {
            return record;
        }
    }
    
    //
    public SqlMapClient getMySqlMapClient(){
        return getSqlMapClientTemplate().getSqlMapClient();
    }

    public void insert_0001(SysRolesPermsMapping record) {
        getSqlMapClientTemplate().insert("SYS_ROLES_PERMS_MAPPING.insert_0001", record);
    }
    
    public int count_0001(Map<String, Object> map) {
        Integer count = (Integer)  getSqlMapClientTemplate().queryForObject("SYS_ROLES_PERMS_MAPPING.count_0001", map);
        return count.intValue();    	
    }
    
    @SuppressWarnings("unchecked")
	public List<SysRolesPermsMapping> select_0001(Map<String, Object> map) {
        List<SysRolesPermsMapping> list = getSqlMapClientTemplate().queryForList("SYS_ROLES_PERMS_MAPPING.select_0001", map);
        return list;
    }
    
    @SuppressWarnings("unchecked")
	public List select_0002(SysRolesPermsMappingExample example) {
        List list = getSqlMapClientTemplate().queryForList("SYS_ROLES_PERMS_MAPPING.select_0002", example);
        return list;
    }    
    
}